#ifndef WARGAME_H
#define WARGAME_H

class WarConnection;
class WarHand;
class WarSavedGame;
class Shue;

class WarGame
{
	public:
		WarGame(WarConnection*, int32 bet);
		WarGame(WarConnection*, WarSavedGame*);
		~WarGame();

		bool8 deal(int32 balance);
		bool8 raise(int32 balance);
		bool8 fold(int32 balance);
		
		int32 getBet();

		void send();
		void save(WarSavedGame*);

	protected:
		bool8 noWar(int32 balance);
		bool8 Finished(bool8 raised, int32 cardIndex, int32 balance);
		
		int32 calcOutcome(int32 cardIndex);
		int32 calcPayouts(int32 *payouts, bool8 raised, bool8 folded,
			int32 cardIndex, int32* outcome);

		void restore(WarSavedGame*);

	protected:
		WarConnection*		conn;
		int32				bet;
		WarHand*			dealer;
		WarHand*			player;
		Shue*				shue;
		//
		// *IMPORTANT*  When adding/changing here, be sure to update
		//				constructors/destructor, send(), save(), restore()
		//
};

inline int32
WarGame::getBet()
{
	return bet;
}

#endif
